package com.zspringboot.demo.service.impl;

import com.zspringboot.demo.controller.dto.TitleOptions;
import com.zspringboot.demo.entity.SpecificContent;
import com.zspringboot.demo.entity.TargetTitle;
import com.zspringboot.demo.mapper.SpecificContentMapper;
import com.zspringboot.demo.mapper.TargetTitleMapper;
import com.zspringboot.demo.service.ITargetTitleService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 项目标题 服务实现类
 * </p>
 *
 * @author laolang
 * @since 2024-03-12
 */
@Service
public class TargetTitleServiceImpl extends ServiceImpl<TargetTitleMapper, TargetTitle> implements ITargetTitleService {


    @Resource
    SpecificContentMapper specificContentMapper;

    /**
     * 获取多选数组内容
     * @param id
     * @return
     */
    @Override
    public List<TitleOptions> getContentS(Integer id) {
        List<TitleOptions> ll = new ArrayList<>();
        List<SpecificContent> list = specificContentMapper.selectTitle(id);
        list.forEach(i ->{
            ll.add(new TitleOptions(i.getId(),i.getContent()));
        });
        return ll;
    }
}
